<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>个人中心——收货地址管理</title>
		<!-- Set render engine for 360 browser -->
		<meta name="renderer" content="webkit">
		<!-- No Baidu Siteapp-->
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<!-- Add to homescreen for Chrome on Android -->
		<meta name="mobile-web-app-capable" content="yes">
		<!-- Add to homescreen for Safari on iOS -->
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="__PUBLIC__/assets/css/amazeui.css">
		<link rel="stylesheet" href="__PUBLIC__/assets/css/app.css">
		<!--[if lt IE 9]>
		<script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
		<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
		<script src="__PUBLIC__/assets/js/amazeui.ie8polyfill.min.js"></script>
		<![endif]-->
		<script type="text/javascript" src="__PUBLIC__/assets/js/jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/assets/js/jquery.validate.js"></script>
		<script type="text/javascript" src="__PUBLIC__/assets/js/validate-ex.js"></script>
		<script src="__PUBLIC__/assets/js/amazeui.js"></script>
		<script type="text/javascript" src="__PUBLIC__/assets/js/app.js"></script>
		<script type="text/javascript" src="__PUBLIC__/assets/js/jump.js"></script>
		<!--鼠标经过导航跳动开始-->
		<!--<script type="text/javascript">
			$(function(){
				 $(".am-topbar-nav li").each(function(k,a){
					new JumpObj(a,5);//晃动幅度
					$(a).hover(function(){this.parentNode.parentNode.addClass("hover")});
				});
		 	}); 
		
		</script>-->
		<!--鼠标经过导航跳动结束-->
		<script type="text/javascript">
			function addr_on(obj){
				$(obj).css("border","2px solid #ffab49");
				$(obj).children(".addr_btn").show();
			}
			function addr_off(obj){
				$(obj).css("border","2px solid #d7d6d6");
				$(obj).children(".addr_btn").hide();
			}
		</script>
		<style type="text/css">
			.am-form select,.am-form textarea, .am-form input[type="text"], .am-form input[type="password"], .am-form input[type="datetime"], .am-form input[type="datetime-local"], .am-form input[type="date"], .am-form input[type="month"], .am-form input[type="time"], .am-form input[type="week"], .am-form input[type="number"], .am-form input[type="email"], .am-form input[type="url"], .am-form input[type="search"], .am-form input[type="tel"], .am-form input[type="color"], .am-form-field {
			    background-color: #ffffff;
			    background-image: none;
			    border: 1px solid #cdcdcd;
			    border-radius: 0;
			    color: #555555;
			    display: block;
			    font-size: 0.98em;
			    line-height: 1.5;
			    padding: 0.5em;
			    transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
			    vertical-align: middle;
			    width: 100%;
			}
			.addr_form label{
				color: #53555c;
				font-weight: normal;
				padding-top: 0 !important;
				text-align: left !important;
			}
			.login_bg {
			    background: rgba(0,0,0,0);
			    padding: 2em;
			}
			.am-form select{
				max-width: 100%;
			}
		</style>
		<!--收货地址验证开始-->
		<script type="text/javascript">
			function addrsave(){
				var addr_name=$("#addr_name").val();
				var addr_phone=$("#addr_phone").val();
				var addr_province=$("#addr_province").val();
				var addr_city=$("#addr_city").val();
				var addr_area=$("#addr_area").val();
				var detail_addr=$("#detail_addr").val();
				var addr_code=$("#addr_code").val();
				
				if(addr_name==""){
					$("#addr_name").css("border","1px solid #ff0000");
					$("#addr_name").next().next("p").show();
					return false;
				}
				$("#addr_name").css("border","1px solid #cccccc");
				$("#addr_name").next().next("p").hide();
				if(addr_phone==""){
					$("#addr_phone").css("border","1px solid #ff0000");
					$("#addr_phone").next().next("p").show();
					return false;
				}
				$("#addr_name").css("border","1px solid #cccccc");
				$("#addr_phone").next().next("p").hide();
				
				var re=/^1([3]\d|4[57]|5[^3]|8\d)\d{8}$/;
			    if(!re.test(addr_phone)){
			    	$("#addr_phone").css("border","1px solid #ff0000");
				    $("#addr_phone").next().next("p").show();
					return false;
			    }
			    $("#addr_phone").css("border","1px solid #cccccc");
			    $("#addr_phone").next().next("p").hide();
			    
				if(addr_province==""){
					$("#addr_province").css("border","1px solid #ff0000");
					$("#detail_addr").next().next("p").show();
					return false;
				}
				$("#addr_province").css("border","1px solid #cccccc");
				$("#detail_addr").next().next("p").hide();
				if(addr_city==""){
					$("#addr_city").css("border","1px solid #ff0000");
					$("#detail_addr").next().next("p").show();
					return false;
				}
				$("#addr_city").css("border","1px solid #cccccc");
				if(addr_area==""){
					$("#addr_area").css("border","1px solid #ff0000");
					$("#detail_addr").next().next("p").show();
					return false;
				}
				$("#addr_area").css("border","1px solid #cccccc");
				$("#detail_addr").next().next("p").hide();
				if(detail_addr==""){
					$("#detail_addr").css("border","1px solid #ff0000");
					$("#detail_addr").next().next("p").show();
					return false;
				}
				$("#detail_addr").css("border","1px solid #cccccc");
				$("#detail_addr").next().next("p").hide();
				if(addr_code==""){
					$("#addr_code").css("border","1px solid #ff0000");
					$("#addr_code").next("p").show();
					return false;
				}
				$("#addr_code").css("border","1px solid #cccccc");
				$("#addr_code").next("p").hide();
				
				var pattern= /^[1-9]\d{5}$/;
			    if(!pattern.test(addr_code)){
			    	$("#addr_code").css("border","1px solid #ff0000");
				    $("#addr_code").next("p").show();
					return false;
			    }
			    $("#addr_code").css("border","1px solid #cccccc");
			    $("#addr_code").next("p").hide();
				
				return true;
			}
		</script>
		<!--收货地址验证结束-->
			<!--收货地址弹出框开始-->
		<div class="am-modal am-modal-no-btn" tabindex="-1" id="addr">
			<div class="am-modal-dialog">
			    <div class="am-modal-bd login_bg">
			        <form class="am-form am-form-horizontal addr_form">
						<div class="am-form-group" style="margin-bottom: 2rem;">
						    <label class="am-u-sm-3 am-u-md-2 am-form-label">收货人</label>
						    <div class="am-u-sm-9 am-u-md-10">
						        <input id="addr_name" type="text" />
						        <span class="rederror redstar">*</span>
						      	<p class="rederror">
						      		请填写收货人姓名
						      	</p>
						    </div>
						</div>
						<div class="am-form-group" style="margin-bottom: 2rem;">
						    <label class="am-u-sm-3 am-u-md-2 am-form-label">手机</label>
						    <div class="am-u-sm-9 am-u-md-10">
						        <input id="addr_phone" type="text" />
						        <span class="rederror redstar">*</span>
						      	<p class="rederror">
						      		请输入联系人电话
						      	</p>
						    </div>
						</div>
						<div class="am-form-group">
						    <label class="am-u-sm-3 am-u-md-2 am-form-label">地址</label>
						    <div class="am-u-sm-9 am-u-md-10" style="text-align: left;">
						        <div class="am-u-md-4 addr_select">
						        	<img src="__PUBLIC__/assets/i/select_icon.png" class="select_icon"/>
						        	<select id="addr_province">
									  <option value="">省份/直辖市</option>
									  <option value="1">黑龙江省黑龙江省黑龙江省</option>
									  <option value="2">吉林省</option>
									  <option value="3">辽宁省</option>
									  <option value="4">河北省</option>
									  <option value="5">山东省</option>
									  <option value="6">河南省</option>
									</select>
						        </div>
						        <div class="am-u-md-4 addr_select select_city" style="padding: 0.2rem;">
						        	<img src="__PUBLIC__/assets/i/select_icon.png" class="select_icon" style="bottom: 0.2rem; right: 0.2rem;"/>
						        	<select id="addr_city">
									  <option value="">城市</option>
									  <option value="1">沈阳市</option>
									  <option value="2">大连市</option>
									  <option value="3">盘锦市</option>
									  <option value="4">营口市</option>
									  <option value="5">丹东市</option>
									  <option value="6">抚顺市</option>
								    </select>
						        </div>
						        <div class="am-u-md-4 addr_select">
						        	<img src="__PUBLIC__/assets/i/select_icon.png" class="select_icon"/>
						        	<select id="addr_area">
									  <option value="">区/县</option>
									  <option value="1">沈阳市</option>
									  <option value="2">大连市</option>
									  <option value="3">盘锦市</option>
									  <option value="4">营口市</option>
									  <option value="5">丹东市</option>
									  <option value="6">抚顺市</option>
								    </select>
						        </div>
						    </div>
						    <div class="am-u-sm-9 am-u-md-10">
						    	<input id="detail_addr" type="text" />
						    	<span class="rederror redstar">*</span>
						    	<p class="rederror">
						      		请填写详细地址
						      	</p>
						    </div>
					      	
						</div>
						<div class="am-form-group" style="margin-bottom: 3rem;">
						    <label class="am-u-sm-3 am-u-md-2 am-form-label">邮编</label>
						    <div class="am-u-sm-9 am-u-md-10">
					       		<input id="addr_code" type="text" />
						        <p class="rederror">
						      		邮编不能为空
						      	</p>
						    </div>
						</div>
						<div class="am-form-group" style="margin-bottom: 3rem;">
							<label class="am-u-sm-3 am-u-md-2"></label>
							<div class="am-u-sm-9 am-u-md-10">
								<div class="am-u-sm-6 am-u-md-8" style="padding: 0 2px 0 0;">
									<button type="submit" class="am-btn btn_save" onclick="return addrsave();">保存</button>
								</div>
								<div class="am-u-sm-6 am-u-md-4" style="padding: 0 0 0 2px;">
									<button type="button" class="am-btn btn_cancel" data-am-modal-close>取消</button>
								</div>
							</div>
					    </div>
					</form>
			    </div>
			</div>
		</div>
		<!--收货地址弹出框结束-->
	</head>
	<body>
		<!--#include file="head.html"-->
		<!--内容开始-->
         <!--#include file="left.html"-->
					<div class="am-u-lg-10" style="padding: 0;">
						<div class="right order_right">
							<div class="order_title" style="border-bottom: 1px solid #d7d6d6;">
								<p>收货地址管理</p>
							</div>
                            	<div class="address_div">
									<div class="am-u-md-4" style="float: left; padding: 2rem 1rem 0rem 0;">
										<a href="javascript:;">
											<div class="address_box am-active">
												<p class="address_name">
												
													<?php echo $address_list[0]['name']; ?>
													<span class="defautaddr">默认地址</span>
												</p>
												<p>
												<?php echo $address_list[0]['tel']; ?>
												</p>
												<p>
													<?php echo $address_list[0]['address']; ?>
													<?php echo $address_list[0]['deaddress']; ?>
												(<?php echo $address_list[0]['postcode']; ?>)
													
												</p>
												<p>
													<a href="javascript:;" data-am-modal="{target: '#edit'}">
													<button type="button" class="am-btn btn_address">编辑</button>
													</a>
													
													<button type="button" class="am-btn btn_address">删除</button>
												</p>
											</div>
										</a>
									</div>
									<div class="am-u-md-4" style="float: left; padding: 2rem 1rem 0rem 0;">
										<a href="javascript:;">
											<div class="address_box" onclick="addr_on(this);" onmouseover="addr_on(this);" onmouseout="addr_off(this);">
												<p class="address_name">
													<?php echo $address_list[1]['name']; ?>
												</p>
												<p>
														<?php echo $address_list[1]['tel']; ?>
												</p>
												<p>
												<?php echo $address_list[1]['address']; ?>
													<?php echo $address_list[1]['deaddress']; ?>
												(<?php echo $address_list[1]['postcode']; ?>)
												</p>
												<p class="addr_btn">
													<button type="button" class="am-btn btn_address">编辑</button>
													<button type="button" class="am-btn btn_address">删除</button>
												</p>
											</div>
										</a>
									</div>
									<div class="am-u-md-4" style="float: left; padding: 2rem 1rem 0rem 0;">
										<a href="javascript:;">
											<div class="address_box" onmouseover="addr_on(this);" onmouseout="addr_off(this);">
												<p class="address_name">
													张三
												</p>
												<p>
													13456211562
												</p>
												<p>
													XX省XX市XX区XX路123号-1-1室(111111)
												</p>
												<p class="addr_btn">
													<button type="button" class="am-btn btn_address">编辑</button>
													<button type="button" class="am-btn btn_address">删除</button>
												</p>
											</div>
										</a>
									</div>
									<div class="am-u-md-4" style="float: left; padding: 2rem 1rem 0rem 0;">
										<a href="javascript:;" data-am-modal="{target: '#addr'}">
											<div class="address_box" style="text-align: center;">
												<p style="margin-top: 5rem;">
														<img src="__PUBLIC__/assets/i/icon_add.png" />
												</p>
												<p>
													新增地址
												</p>
											</div>
										</a>
									</div>
								</div>
						
			
							</div>
		</div>
	<!--内容结束-->
		<!--#include file="foot.html"-->
	</body>
</html>
